
cmake_minimum_required(VERSION 3.18.1)


project("ffmpeg")

add_library( # Sets the name of the library.
        ffmpeg

        # Sets the library as a shared library.
        SHARED

        # Provides a relative path to your source file(s).
        native-lib.cpp)
#引入头文件
include_directories(${CMAKE_SOURCE_DIR}/include)
#引入库文件
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L${CMAKE_SOURCE_DIR}/${CMAKE_ANDROID_ARCH_ABI}")

find_library( # Sets the name of the path variable.
        log-lib

        # Specifies the name of the NDK library that
        # you want CMake to locate.
        log)

target_link_libraries( # Specifies the target library.
        ffmpeg
        #依赖有顺序问题
        avformat avcodec avfilter avutil swresample swscale
        # Links the target library to the log library
        # included in the NDK.
        ${log-lib})